<div class="main layui-clear">
    <div class="wrap">
        <div class="content">
            <div class="fly-tab">
                <div class="layui-tab layui-tab-brief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">
                            <a href="__ROOT__">
                                首页
                            </a>
                        </li>
                        <li>
                            <a href="{:U('home/index/all')}">
                                全部帖
                            </a>
                        </li>
                        <li>
                            <a href="/jie/unsolved/">
                                未结帖
                            </a>
                        </li>
                        <li>
                            <a href="/jie/solved/">
                                已采纳
                            </a>
                        </li>
                        <li>
                            <a href="/jie/wonderful/">
                                精华帖
                            </a>
                        </li>
                        <li>
                            <a href="/user/">
                                我的帖
                            </a>
                        </li>
                    </ul>
                </div>
                <style type="text/css">
                    form{
                        position: absolute;
                        top: 0px;
                        right: 0px;
                    }
                    .layui-tab{
                        position: relative;
                    }

                    form input{
                        height: 50px;
                    }

                </style>
                <form action="{:U('home/search/index')}" method="get">
                    <input type="text" name="q">
                    <input class="layui-icon fly-search" type="submit" value="&#xe615;">
                </form>
            </div>
            <ul class="fly-panel fly-list fly-list-top">
                <?php foreach ($topQues as $row) { ?>
                <li class="fly-list-li">
                    <a href="{:U('home/u/index',array('id'=>$row['uid']))}" class="fly-list-avatar">
                        <img src="__ROOT__/<?php echo $row['face'] ?>" alt="贤心">
                    </a>
                    <h2 class="fly-tip">
                        <a href="{:U('home/jie/index',array('id'=>$row['qid']))}">
                           <?php echo $row['title'] ?>
                        </a>
                        <span class="fly-tip-stick">
                            <?php if($row['top']==1){
                                echo "置顶";
                            }elseif($row['top']==2){
                                echo "精华";
                            } ?>
                        </span>
                    </h2>
                    <p>
                        <span>
                            <a href="/u/168">
                                <?php echo $row['nickname'] ?>
                            </a>
                        </span>
                        <span>
                            <?php echo Ctime($row['create_time']) ?>
                        </span>
                        <span>
                            <?php echo $row['cname'] ?>
                        </span>
                        <span class="fly-list-hint">
                            <i class="iconfont" title="回答">
                                &#xe60c;
                            </i>
                            <?php echo $row['answer_num'] ?>
                            <i class="iconfont" title="人气">
                                &#xe60b;
                            </i>
                            <?php echo $row['view_num'] ?>
                        </span>
                    </p>
                </li>
                <?php } ?>
            </ul>
            <ul class="fly-panel fly-list">
                <?php foreach ($question as $row) { ?>
                <li class="fly-list-li">
                    <a href="{:U('home/u/index',array('id'=>$row['uid']))}" class="fly-list-avatar">
                        <img src="__ROOT__/<?php echo $row['face'] ?>" alt="贤心">
                    </a>
                    <h2 class="fly-tip">
                        <a href="./news/<?php echo $row['qid'] ?>">
                           <?php echo $row['title'] ?>
                        </a>
                        
                        <?php if($row['top']==1){
                            echo "<span class='fly-tip-stick'>置顶</span>";
                        }elseif($row['top']==2){
                            echo "<span class='fly-tip-jing'>精华</span>";
                        } ?>
                        
                    </h2>
                    <p>
                        <span>
                            <a href="/u/168">
                                <?php echo $row['nickname'] ?>
                            </a>
                        </span>
                        <span>
                            <?php echo Ctime($row['create_time']) ?>
                        </span>
                        <span>
                            <?php echo $row['cname'] ?>
                        </span>
                        <span class="fly-list-hint">
                            <i class="iconfont" title="回答">
                                &#xe60c;
                            </i>
                            <?php echo $row['answer_num'] ?>
                            <i class="iconfont" title="人气">
                                &#xe60b;
                            </i>
                            <?php echo $row['view_num'] ?>
                        </span>
                    </p>
                </li>
                <?php } ?>
            </ul>
            <div style="text-align: center">
                <div class="laypage-main">
                    <a href="{:U('home/index/all',array('p'=>2))}" class="laypage-next">
                        更多求解
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="edge">
        <div class="jie-add">
            <a href="{:U('home/jie/add')}" class="layui-btn layui-btn-big">
                发表新帖
            </a>
            <a href="javascript:layer.msg('尚未开放');" class="layui-btn layui-btn-big layui-btn-normal"
            style="margin-left: 10px;">
                共享组件
            </a>
        </div>
        <div class="fly-panel leifeng-rank">
            <h3 class="fly-panel-title">
                回答月榜
            </h3>
            <dl>
                <?php foreach ($hotUser as $row) { ?>
                <dd>
                    <a href="{:U('home/u/index',array('id'=>$row['uid']))}">
                        <img src="__ROOT__/<?php echo $row['face'] ?>">
                        <cite>
                            <?php echo $row['nickname'] ?>
                        </cite>
                        <i>
                            <?php echo $row['answer_num'] ?>次回答
                        </i>
                    </a>
                </dd>
                <?php } ?>
            </dl>
        </div>
        <dl class="fly-panel fly-list-one">
            <dt class="fly-panel-title">
                近期热议
            </dt>
            <?php foreach ($hotQues as $row) { ?>
                <dd>
                    <a href="{:U('home/jie/index',array('id'=>$row['qid']))}">
                        <?php echo $row[ 'title'] ?>
                    </a>
                    <span>
                        <i class="iconfont">
                            &#xe60c;
                        </i>
                        <?php echo $row[ 'answer_num'] ?>
                    </span>
                </dd>
            <?php } ?>
        </dl>
        <div class="fly-panel fly-link">
            <h3 class="fly-panel-title">
                友情链接
            </h3>
            <dl>
                <dd>
                    <a href="http://layim.layui.com/" target="_blank">
                        WebIM
                    </a>
                </dd>
            </dl>
        </div>
    </div>
</div>